import QtQuick 2.0
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import "qrc:///MyControls"

Popup{
    id:popDialog
    property alias title: popTitle.text

    signal newGame()

    modal: true
    focus: true
    closePolicy: Popup.CloseOnPressOutside
    margins: 10
    anchors.centerIn: parent


    background: Rectangle{
        id:popBg
        color: CTheme.background
        radius: CTheme.dialogRadius
    }

    ColumnLayout{
        anchors.fill: parent

        Text{
            id:popTitle
            color: "#ffffff"
            text: qsTr("标题")
            Layout.alignment: Qt.AlignHCenter
        }
        RowLayout{
            id:layoutRow
            CButton{
                id:btnNew
                text: "再来一局"
                width:80
                height: 40
                onClicked: {
                    newGame();
                    close();
                }
            }

            CButton{
                id:btnClose
                text: "再看看"
                width:80
                height: 40
                lineColor: CTheme.redColor
                onClicked: {
                    close();
                }
            }
        }
    }
//    DropShadow{
//        anchors.fill: popDialog.parent
//        source: popDialog
//        horizontalOffset: 5
//        verticalOffset: 5
//        radius: 8.0
//        samples: 16
//        color: "#ffffff"
//    }
}
